<?php

require_once 'phpmoko/ui/Panel.php';

class VerticalPanel extends Panel
{
	function __construct()
	{
		parent::__construct();
	}

	function toString()
	{
		$str = '<table cellpadding="0" cellspacing="'.$this->spacing.'"';

		if ($this->id != null)
			$str .= ' id="'.$this->id.'"';

		if ($this->getWidth() != null)
			$str .= ' width="'.$this->getWidth().'"';

		$str .= '>';

		foreach ($this as $widget)
		{
			$str .= '<tr><td';

			if ($widget->getHorizontalAlignment() != null)
				$str .= ' align="'.$widget->getHorizontalAlignment().'"';

			if ($widget->getVerticalAlignment() != null)
				$str .= ' valign="'.$widget->getVerticalAlignment().'"';

			if ($widget->getHeight() != null)
				$str .= ' height="'.$widget->getHeight().'"';

			$str .= '>'.$widget->toString().'</td></tr>';
		}

		$str .= '</table>';

		return $str;
	}
}
?>